package com.moleq.base;

import android.database.sqlite.SQLiteDatabase;

public class MQConnection {

	private SQLiteDatabase mDB = null;
//	private String mDbPath = "";

//	public void setDbPath(String dbPath) {
//		mDbPath = dbPath;
//	}

	public SQLiteDatabase getDB() {
		return mDB;
	}
	
	public void open(String dbPath){
//		mDbPath = dbPath;
		try {
			mDB = SQLiteDatabase.openOrCreateDatabase(dbPath, null);
		} catch (Exception e) {
			mDB = null;
		}
	}

	public boolean isConnected() {
		boolean result = false;
		if (mDB != null) {
			result = mDB.isOpen();
		}
		return result;
	}
	
	public void close(){
		mDB = null;
	}

}
